in your relationship you are missing return statement,
please follow the following example
public function user() {
$this->belongsTo(User::class,'user_id','id');
}
to
public function user() {
return $this->belongsTo(User::class,'user_id','id');
}